package org.sandbox2.web;

import org.sandbox2.domain.loan.LoanDto;
import org.springframework.roo.addon.web.mvc.controller.RooWebScaffold;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@RooWebScaffold(path = "loandtoes", formBackingObject = LoanDto.class)
@RequestMapping("/loandtoes")
@Controller
public class LoanDtoController {
	
	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
    public String show(@PathVariable("id") Long id, Model uiModel) {
        addDateTimeFormatPatterns(uiModel);
        uiModel.addAttribute("loandto", LoanDto.findLoanDto(id));
        uiModel.addAttribute("itemId", id);
        return "loandtoes/show";
    }
}
